package day05;

import java.util.Scanner;

public class Test4 {
    public static void main(String[] args) {
        System.out.println("给宠物起个名字:");
        String name = new Scanner(System.in).nextLine();
        Dog dog = new Dog();
        dog.name = name;
        dog.full = 50;
        dog.happy = 50;
        while (true){
            double d = Math.random();
            if(d < 0.33){
                dog.feed();
            }else if(d < 0.66){
                dog.play();
            }else{
                dog.punish();
            }
            new Scanner(System.in).nextLine();
        }
    }
}
